#ifndef OBJECT_H
#define OBJECT_H

#include "vector3.h"
#include <stdio.h>

class Object
{
protected:
    Vector3 POS;
    Vector3 DIR;
    Vector3 UP;
public:
    Object (){};
    Object (Object *O)
    {
        POS = O->getPOS();
        DIR = vector_normalize(O->getDIR());
        UP = vector_normalize(O->getUP());
    }

    Object (Vector3 newPOS)
    {
        POS = newPOS;
    }

    Object (Vector3 newPOS, Vector3 newDIR)
    {
        POS = newPOS;
        DIR = vector_normalize(newDIR);
    }

    Object (Vector3 newPOS, Vector3 newDIR, Vector3 newUP)
    {
        POS = newPOS;
        DIR = vector_normalize(newDIR);
        UP = vector_normalize(newUP);
    }

    Vector3 const getPOS(){return POS;}
    Vector3 const getDIR(){return DIR;}
    Vector3 const getUP(){return UP;}

    void setPOS(Vector3 newPOS){POS = newPOS;}
    void setDIR(Vector3 newDIR){DIR = vector_normalize(newDIR);}
    void setUP(Vector3 newUP){UP = vector_normalize(newUP);}
    int const writeToFile(FILE *f);
    int const writeToFile(char *name);
    int readFromFile(FILE *f);
    int readFromFile(char *name);

    void rotateUpGrad(double angle);
    void rotateUpRad(double angle);
    void rotateDownGrad(double angle);
    void rotateDownRad(double angle);
    void rotateLeftGrad(double angle);
    void rotateLeftRad(double angle);
    void rotateRightGrad(double angle);
    void rotateRightRad(double angle);
};

#endif // OBJECT_H
